package com.after.saas.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * @Classname MenuDTO
 * @Description TODO
 * @Date 2021/5/31 14:02
 * @Created by hjchen
 */

@Data
@Accessors(chain = true)
@ApiModel(value = "树形菜单", description = "树形结构")
public class TreeEntity<T> implements Serializable {

    @ApiModelProperty(value = "菜单ID")
    private String id;

    @ApiModelProperty(value = "父菜单ID")
    private String parentId;

    @JsonIgnore
    @ApiModelProperty(value = "是否有子菜单")
    private boolean hasChildren;

    @ApiModelProperty(value = "树形结构")
    private List<T> children = new ArrayList();
}
